package com.gudy.counter.Controller;

import com.gudy.counter.bean.CounterRes;
import com.gudy.counter.bean.Transaction;
import com.gudy.counter.service.TranSactionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping(value = "/transaction")
public class TranSactionController {

    @Autowired
    private TranSactionService tranSactionService;
    @RequestMapping(value = "/rechargeAmount")
    public CounterRes rechargeAmount(Transaction transaction, @RequestParam String token){
        return tranSactionService.rechargeAmount(transaction,token);

    }

    @RequestMapping(value = "/queryTransaction")
    public CounterRes queryTransaction(HttpServletRequest request){
        return tranSactionService.queryTransaction(request);
    }
}
